<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<div class="panel">
    <div id="classes-heading" class="panel-heading bg-gray-light">
        <h3 class="panel-title">楼宇基建信息<span id="title-duty-name-buildInfo" class="text-muted"> | </span></h3>

        <ul class="nav nav-tabs" data-ul="buildInfo_nav_ul">
            <li class="active"><a th:href="'#to_buildInfo_tab1'+${buildInfo?.id}" th:id="'buildInfo_tab1'+${buildInfo?.id}" data-toggle="tab">楼宇基建</a></li>
            <li class=""><a th:href="'#to_buildInfo_tab2'+${buildInfo?.id}" th:id="'buildInfo_tab2'+${buildInfo?.id}" data-toggle="tab">楼层特征区域信息</a></li>
            <li class=""><a th:href="'#to_buildInfo_tab3'+${buildInfo?.id}" th:id="'buildInfo_tab3'+${buildInfo?.id}" data-toggle="tab">楼层功能划分</a></li>
            <li class=""><a th:href="'#to_buildInfo_tab4'+${buildInfo?.id}" th:id="'buildInfo_tab4'+${buildInfo?.id}" data-toggle="tab">图纸</a></li>
            <li class=""><a th:href="'#to_buildInfo_tab5'+${buildInfo?.id}" th:id="'buildInfo_tab5'+${buildInfo?.id}" data-toggle="tab">更多信息</a></li>
        </ul>

    </div>

    <div class="panel-body">
        <div class="tab-content">
            <div class="tab-pane fade in active" th:id="'to_buildInfo_tab1'+${buildInfo?.id}">
                <form th:id="'form_buildInfo_input'+${buildInfo?.id}" class="form-horizontal" autocomplete="off">
                    <input type="hidden" name="keyId" th:value="${buildInfo?.id}">
                    <input type="hidden" name="flowDutyId">
                    <input type="hidden" name="flowDutyName">

                    <div class="form-group">
                        <label class="col-md-2 control-label">楼编号<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="buildNo" id="buildNo" th:value="${buildInfo?.buildNo}" class="form-control" placeholder="楼编号">
                        </div>

                        <label class="col-md-2 control-label">楼域名<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="name" id="name" th:value="${buildInfo?.name}" class="form-control" placeholder="楼域名">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">曾用名</label>
                        <div class="col-md-3">
                            <input type="text" name="onceName" id="onceName" th:value="${buildInfo?.onceName}" class="form-control" placeholder="曾用名">
                        </div>

                        <label class="col-md-2 control-label">位置<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="location" id="location" th:value="${buildInfo?.location}" class="form-control" placeholder="位置">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">建筑面积<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="buildMeasure" id="buildMeasure" th:value="${buildInfo?.buildMeasure}" class="form-control" placeholder="建筑面积">
                        </div>

                        <label class="col-md-2 control-label">建筑高度<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="buildHeight" id="buildHeight" th:value="${buildInfo?.buildHeight}" class="form-control" placeholder="建筑高度">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">地上层数<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="number" name="floorUpCount" id="floorUpCount" th:value="${buildInfo?.floorUpCount}" class="form-control" placeholder="地上层数">
                        </div>

                        <label class="col-md-2 control-label">地下层数<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="number" name="floorDownCount" id="floorDownCount" th:value="${buildInfo?.floorDownCount}" class="form-control" placeholder="地下层数">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">是否存在中间层<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-8">
                            <div class="radio">
                                <input type="radio" name="ifHasMiddleFloor" id="ifHasMiddleFloor1" value="1" class="magic-radio" th:checked="${buildInfo?.ifHasMiddleFloor == 1}" >
                                <label for="ifHasMiddleFloor1">是</label>
                                <input type="radio" name="ifHasMiddleFloor" id="ifHasMiddleFloor0" value="0" class="magic-radio" th:checked="${buildInfo?.ifHasMiddleFloor == 0}" >
                                <label for="ifHasMiddleFloor0">否</label>
                            </div>
                        </div>
                    </div>

                    <div id="floorOfMiddleDiv" class="form-group" th:hidden="${buildInfo==null || buildInfo.ifHasMiddleFloor!=1}" >
                        <label class="col-md-2 control-label">中间层</label>
                        <div class="col-md-8">
                            <input type="text" name="floorOfMiddle" id="floorOfMiddle" th:value="${#strings.replace(buildInfo?.floorOfMiddle, ',', '|')}" class="form-control" placeholder="中间层">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">竣工时间<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="completedDate" id="completedDate" th:value="${#dates.format(buildInfo?.completedDate, 'yyyy-MM')}" class="form-control" placeholder="竣工时间">
                        </div>

                        <label class="col-md-2 control-label">投资额（万元）<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="investmentAmount" id="investmentAmount" th:value="${buildInfo?.investmentAmount}" class="form-control" placeholder="投资额（万元）">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">土建安装工程造价<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="installCost" id="installCost" th:value="${buildInfo?.installCost}" class="form-control" placeholder="土建安装工程造价">
                        </div>

                        <label class="col-md-2 control-label">造价依据<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <select id="costBasisDictId" name="costBasisDictId" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="dict : ${costBasisDictList}" th:id="${dict.id}" th:value="${dict.id}" th:text="${dict.name}" th:selected="${dict == buildInfo?.costBasisDict}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">产权拥有者<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <input type="text" name="propertyOwner" id="propertyOwner" th:value="${buildInfo?.propertyOwner}" class="form-control" placeholder="产权拥有者">
                        </div>

                        <label class="col-md-2 control-label">建筑用途<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <select id="buildUseDictId" name="buildUseDictId" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="dict : ${buildUseDictList}" th:id="${dict.id}" th:value="${dict.id}" th:text="${dict.name}" th:selected="${dict == buildInfo?.buildUseDict}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">建筑结构<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <select id="buildStructureDictId" name="buildStructureDictId" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="dict : ${buildStructureDictList}" th:id="${dict.id}" th:value="${dict.id}" th:text="${dict.name}" th:selected="${dict == buildInfo?.buildStructureDict}"></option>
                            </select>
                        </div>

                        <label class="col-md-2 control-label">建筑状态<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <select id="buildStateDictId" name="buildStateDictId" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="dict : ${buildStateDictList}" th:id="${dict.id}" th:value="${dict.id}" th:text="${dict.name}" th:selected="${dict == buildInfo?.buildStateDict}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">房屋防水等级<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <select id="waterproofLevelDictId" name="waterproofLevelDictId" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="dict : ${waterproofLevelDictList}" th:id="${dict.id}" th:value="${dict.id}" th:text="${dict.name}" th:selected="${dict == buildInfo?.waterproofLevelDict}"></option>
                            </select>
                        </div>

                        <label class="col-md-2 control-label">抗震烈度<i class="fa fa-asterisk txt-color-red"></i></label>
                        <div class="col-md-3">
                            <select id="seismicLevelDictId" name="seismicLevelDictId" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="dict : ${seismicLevelDictList}" th:id="${dict.id}" th:value="${dict.id}" th:text="${dict.name}" th:selected="${dict == buildInfo?.seismicLevelDict}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">门用材料</label>
                        <div class="col-md-8">
                            <div class="checkbox">
                                <input type="checkbox" name="materialOfDoor" id="materialOfDoor1"  value="木门" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfDoor, ''),'木门')}" >
                                <label for="materialOfDoor1">木门</label>
                                <input type="checkbox" name="materialOfDoor" id="materialOfDoor2"  value="塑钢门" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfDoor, ''),'塑钢门')}" >
                                <label for="materialOfDoor2">塑钢门</label>
                                <input type="checkbox" name="materialOfDoor" id="materialOfDoor3"  value="铝合金门" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfDoor, ''),'铝合金门')}" >
                                <label for="materialOfDoor3">铝合金门</label>
                                <input type="checkbox" name="materialOfDoor" id="materialOfDoor4"  value="其他" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfDoor, ''),'其他')}" >
                                <label for="materialOfDoor4">其他</label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">窗用材料</label>
                        <div class="col-md-8">
                            <div class="checkbox">
                                <input type="checkbox" name="materialOfWindow" id="materialOfWindow1"  value="塑钢窗" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfWindow, ''),'塑钢窗')}" >
                                <label for="materialOfWindow1">塑钢窗</label>
                                <input type="checkbox" name="materialOfWindow" id="materialOfWindow2"  value="铝合金窗" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfWindow, ''),'铝合金窗')}" >
                                <label for="materialOfWindow2">铝合金窗</label>
                                <input type="checkbox" name="materialOfWindow" id="materialOfWindow3"  value="其他" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfWindow, ''),'其他')}" >
                                <label for="materialOfWindow3">其他</label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">墙用材料</label>
                        <div class="col-md-8">
                            <div class="checkbox">
                                <input type="checkbox" name="materialOfWall" id="materialOfWall1"  value="涂料" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfWall, ''),'涂料')}" >
                                <label for="materialOfWall1">涂料</label>
                                <input type="checkbox" name="materialOfWall" id="materialOfWall2"  value="油漆" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfWall, ''),'油漆')}" >
                                <label for="materialOfWall2">油漆</label>
                                <input type="checkbox" name="materialOfWall" id="materialOfWall3"  value="石材" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfWall, ''),'石材')}" >
                                <label for="materialOfWall3">石材</label>
                                <input type="checkbox" name="materialOfWall" id="materialOfWall4"  value="其他" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfWall, ''),'其他')}" >
                                <label for="materialOfWall4">其他</label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">地坪材料</label>
                        <div class="col-md-8">
                            <div class="checkbox">
                                <input type="checkbox" name="materialOfFloor" id="materialOfFloor1"  value="木地板" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfFloor, ''),'木地板')}" >
                                <label for="materialOfFloor1">木地板</label>
                                <input type="checkbox" name="materialOfFloor" id="materialOfFloor2"  value="石材" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfFloor, ''),'石材')}" >
                                <label for="materialOfFloor2">石材</label>
                                <input type="checkbox" name="materialOfFloor" id="materialOfFloor3"  value="磨石子" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfFloor, ''),'磨石子')}" >
                                <label for="materialOfFloor3">磨石子</label>
                                <input type="checkbox" name="materialOfFloor" id="materialOfFloor4"  value="水泥" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfFloor, ''),'水泥')}" >
                                <label for="materialOfFloor4">水泥</label>
                                <input type="checkbox" name="materialOfFloor" id="materialOfFloor5"  value="PVC" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfFloor, ''),'PVC')}" >
                                <label for="materialOfFloor5">PVC</label>
                                <input type="checkbox" name="materialOfFloor" id="materialOfFloor6"  value="其他" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfFloor, ''),'其他')}" >
                                <label for="materialOfFloor6">其他</label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">外墙材料</label>
                        <div class="col-md-8">
                            <div class="checkbox">
                                <input type="checkbox" name="materialOfOuterWall" id="materialOfOuterWall1"  value="玻璃幕墙" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfOuterWall, ''),'玻璃幕墙')}" >
                                <label for="materialOfOuterWall1">玻璃幕墙</label>
                                <input type="checkbox" name="materialOfOuterWall" id="materialOfOuterWall2"  value="石材" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfOuterWall, ''),'石材')}" >
                                <label for="materialOfOuterWall2">石材</label>
                                <input type="checkbox" name="materialOfOuterWall" id="materialOfOuterWall3"  value="面砖" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfOuterWall, ''),'面砖')}" >
                                <label for="materialOfOuterWall3">面砖</label>
                                <input type="checkbox" name="materialOfOuterWall" id="materialOfOuterWall4"  value="涂料" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfOuterWall, ''),'涂料')}" >
                                <label for="materialOfOuterWall4">涂料</label>
                                <input type="checkbox" name="materialOfOuterWall" id="materialOfOuterWall5"  value="马赛克贴面" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfOuterWall, ''),'马赛克贴面')}" >
                                <label for="materialOfOuterWall5">马赛克贴面</label>
                                <input type="checkbox" name="materialOfOuterWall" id="materialOfOuterWall6"  value="其他" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfOuterWall, ''),'其他')}" >
                                <label for="materialOfOuterWall6">其他</label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">屋内顶材料</label>
                        <div class="col-md-8">
                            <div class="checkbox">
                                <input type="checkbox" name="materialOfRoof" id="materialOfRoof1"  value="涂料" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfRoof, ''),'涂料')}" >
                                <label for="materialOfRoof1">涂料</label>
                                <input type="checkbox" name="materialOfRoof" id="materialOfRoof2"  value="石膏板" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfRoof, ''),'石膏板')}" >
                                <label for="materialOfRoof2">石膏板</label>
                                <input type="checkbox" name="materialOfRoof" id="materialOfRoof3"  value="矿棉板" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfRoof, ''),'矿棉板')}" >
                                <label for="materialOfRoof3">矿棉板</label>
                                <input type="checkbox" name="materialOfRoof" id="materialOfRoof4"  value="铝合金板" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfRoof, ''),'铝合金板')}" >
                                <label for="materialOfRoof4">铝合金板</label>
                                <input type="checkbox" name="materialOfRoof" id="materialOfRoof5"  value="其他" class="magic-checkbox" th:checked="${#strings.contains(#objects.nullSafe(buildInfo?.materialOfRoof, ''),'其他')}" >
                                <label for="materialOfRoof5">其他</label>
                            </div>
                        </div>
                    </div>

                </form>
            </div>

            <div class="tab-pane fade in" th:id="'to_buildInfo_tab2'+${buildInfo?.id}">2</div>
            <div class="tab-pane fade in" th:id="'to_buildInfo_tab3'+${buildInfo?.id}">3</div>
            <div class="tab-pane fade in" th:id="'to_buildInfo_tab4'+${buildInfo?.id}">4</div>
            <div class="tab-pane fade in" th:id="'to_buildInfo_tab5'+${buildInfo?.id}">5</div>
        </div>

    </div>
</div>

<script th:inline="javascript">
    var keyId_buildInfo = [[${buildInfo?.id}]];
    var flowData_buildInfo = {
        keyId : keyId_buildInfo ? keyId_buildInfo : "create",
        formId : "form_buildInfo_input"+[[${buildInfo?.id}]],
        path : "com.hanqian.kepler.core.entity.primary.education.BuildInfo",
        titleId : "title-duty-name-buildInfo"
    };
    var $form = $("#"+flowData_buildInfo.formId);

    $(function(){
        $form.find("input,select").attr("disabled", true);

        __flow_duty_handle(flowData_buildInfo);
        __flow_button_read_handle(flowData_buildInfo, fn_buildInfo_approve, fn_buildInfo_back, fn_buildInfo_deny, fn_buildInfo_edit, fn_buildInfo_withdraw);

        __select2(flowData_buildInfo.formId + " #costBasisDictId");
        __select2(flowData_buildInfo.formId + " #buildUseDictId");
        __select2(flowData_buildInfo.formId + " #buildStructureDictId");
        __select2(flowData_buildInfo.formId + " #buildStateDictId");
        __select2(flowData_buildInfo.formId + " #waterproofLevelDictId");
        __select2(flowData_buildInfo.formId + " #seismicLevelDictId");
    });

    function fn_buildInfo_approve(){
        __confirm_dialog("", "确定通过审批吗？", function(dialogRef){
            __form_save(flowData_buildInfo.formId, "/buildInfo/approve", function(data){
                if(data && data.state === 1){
                    dialogRef.close();
                    __flow_close_layx(flowData_buildInfo);
                }
            })
        });
    }

    function fn_buildInfo_back(){
        __confirm_dialog("", "确定退回吗？", function(dialogRef){
            __form_save(flowData_buildInfo.formId, "/buildInfo/back", function(data){
                if(data && data.state === 1){
                    dialogRef.close();
                    __flow_close_layx(flowData_buildInfo);
                }
            })
        });
    }

    function fn_buildInfo_deny(){
        __confirm_dialog("", "确定否决吗？", function(dialogRef){
            __form_save(flowData_buildInfo.formId, "/buildInfo/deny", function(data){
                if(data && data.state === 1){
                    dialogRef.close();
                    __flow_close_layx(flowData_buildInfo);
                }
            })
        });
    }

    function fn_buildInfo_edit(){
        __flow_close_layx(flowData_buildInfo);
        __layX_html_read(flowData_buildInfo.keyId, "班级管理", "/buildInfo/input?keyId="+flowData_buildInfo.keyId);
    }

    function fn_buildInfo_withdraw(){
        __confirm_dialog("", "确定撤回吗？", function(dialogRef){
            __form_save(flowData_buildInfo.formId, "/buildInfo/withdraw", function(data){
                if(data && data.state === 1){
                    dialogRef.close();
                    __flow_close_layx(flowData_buildInfo);
                }
            })
        });
    }

    //切换标签页要清理流程按钮组
    $("ul[data-ul='buildInfo_nav_ul']").on("click", "li", function(){
        __flow_button_clean_handle(flowData_buildInfo);
    });

    //点击自身 需要重新获取流程按钮组
    $("#buildInfo_tab1"+keyId_buildInfo).on("click", function(){
        __flow_button_read_handle(flowData_buildInfo, fn_buildInfo_approve, fn_buildInfo_back, fn_buildInfo_deny, fn_buildInfo_edit);
    });

    //进入图纸
    $("#buildInfo_tab4"+keyId_buildInfo).on("click", function(){
        loadURL("/main/menu/education/buildInfoDraw?parentId="+keyId_buildInfo, $("#to_buildInfo_tab4"+keyId_buildInfo));
    });

    //进入更多信息
    $("#buildInfo_tab5"+keyId_buildInfo).on("click", function(){
        loadURL("/buildInfoMore/inputOrRead?parentId="+keyId_buildInfo, $("#to_buildInfo_tab5"+keyId_buildInfo));
    });

</script>

</html>